Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diversify Icon Detection (Icons for Steam, Local PC, and Microsoft Store Applications) #3189

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mrixner
Copy link
Contributor

@mrixner mrixner commented Jan 14, 2025

  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • This PR is not composed of garbage changes used to farm GitHub activity to enter potential Crypto AirDrops.
    Any user suspected of farming GitHub activity with crypto purposes will get banned. Submitting broken code wastes the contributors' time, who have to spend their free time reviewing, fixing, and testing code that does not even compile breaks other features, or does not introduce any useful changes. I appreciate your understanding.

This pull request allows adding icons to apps from Steam, Local PC, or Microsoft Store sources much more easily. I don't have an GOG or Ubisoft Connect apps installed, so I couldn't add cases for them, and the Android Subsystem for Linux I believe has been discontinued so I didn't bother with that either.

Steam IDs resolve to just a bunch of random numbers, and I didn't know if that would fit with the current sheet (after all, what are random numbers supposed to tell you?), so I prefixed it with steam: to clarify that it's a Steam app. Local PC I left as it is (removing the extra metadata), because while some are UUIDs some are also actual package names*. Microsoft Store apps I removed the MSIX\ and publisher (like WinGet's integration does) as well as removing the random character identifier at the end (e.g. MSIX\Microsoft.OneDriveSync_24226.1110.4.O_neutral_8wekyb3d8bbwe -> OneDriveSync).

*
image
image

This PR also enables Steam screenshots / metadata via the internal Steam API. I was unable to find an API call to get the square logos used in the library page, though, so unless one of the rectangular icons the API DOES provide (which if you would like is not currently implemented and would need me to go back and change something) is acceptable, Steam packages will have to rely on user contributions.

NOTE: Currently, in the Package Details page, the "download installer" button opens the Steam install dialog as it is supposed to, but also a random Windows system dialog saying "there's no app on your PC that can open this about: link", which doesn't make sense since I have no about: links being started. The installer url field also does not properly open the Steam install dialog when clicked, despite it being the same URL used for the working Download installer button, but I think that's intentional, right?
image
image

I tried to put the Steam check in the IWinGetManagerHelpers class but I'm not proficient enough with C# to have a virtual interface body method that I can call in an overriding class, so I just duplicated the implementation.

@marticliment
Copy link
Owner

marticliment commented Jan 15, 2025

NOTE: Currently, in the Package Details page, the "download installer" button opens the Steam install dialog as it is supposed to, but also a random Windows system dialog saying "there's no app on your PC that can open this about: link", which doesn't make sense since I have no about: links being started. The installer url field also does not properly open the Steam install dialog when clicked, despite it being the same URL used for the working Download installer button, but I think that's intentional, right?

I am aware of the microsoft store popup, and I will fix it on the Download improvements PR. However, the steam link sometimes working and sometimes not is something I will have to investigate. In fact, steam apps shouldn't even show a download URL...

@marticliment
Copy link
Owner

I tried to put the Steam check in the IWinGetManagerHelpers class but I'm not proficient enough with C# to have a virtual interface body method that I can call in an overriding class, so I just duplicated the implementation.

I will see what I can do to not have this code duplicated.

@marticliment
Copy link
Owner

I honestly don't think the steam game banners would work as icons, as they show too much detail.

However, I will see if the .ico file can be easily extracted from a game installation, as the desktop shodtcuts show more suited icons.

@mrixner
Copy link
Contributor Author

mrixner commented Jan 15, 2025

In fact, steam apps shouldn't even show a download URL...

I know; this is something I added in this PR, when I added Steam package details. It's a link to the steam browser protocol (steam://install/id), but clicking it doesn't open Steam like "Download installer" does (which it should, since they use the same Steam browser protocol link).

It's also not sometimes working / sometimes not; it always works when you press "Download installer"; it never works just clicking the link.

@marticliment
Copy link
Owner

I know; this is something I added in this PR, when I added Steam package details. It's a link to the steam browser protocol (steam://install/id), but clicking it doesn't open Steam like "Download installer" does (which it should, since they use the same Steam browser protocol link).

To be honest, I don't think it is really important to show that download URL, since steam apps only show on the installed packages page, so the user must already have them installed... Steam games won't show on the discover or updates pages.

@marticliment
Copy link
Owner

marticliment commented Jan 15, 2025

Furthermore, Local packages (Steam packages are local packages) shouldn't be able to show their package details... The entry on the context menu should be greyed out, and the toolbar button shouldn't work either...

@mrixner
Copy link
Contributor Author

mrixner commented Jan 15, 2025

I honestly don't think the steam game banners would work as icons, as they show too much detail.

However, I will see if the .ico file can be easily extracted from a game installation, as the desktop shodtcuts show more suited icons.

Yeah, not the banners, but the API I used has a "logo" property; it's not a square and is fairly large, but I think it's possible it could work, but I don't think it fits great, hence why I didn't add it initially.

@mrixner
Copy link
Contributor Author

mrixner commented Jan 15, 2025

I know; this is something I added in this PR, when I added Steam package details. It's a link to the steam browser protocol (steam://install/id), but clicking it doesn't open Steam like "Download installer" does (which it should, since they use the same Steam browser protocol link).

To be honest, I don't think it is really important to show that download URL, since steam apps only show on the installed packages page, so the user must already have them installed... Steam games won't show on the discover or updates pages.

Yeah, you're right. I was just trying to fill out the details page with whatever was applicable... Sorry, I'll remove it.

@mrixner
Copy link
Contributor Author

mrixner commented Jan 15, 2025

Furthermore, Local packages (Steam packages are local packages) shouldn't be able to show their package details... The entry on the context menu should be greyed out, and the toolbar button shouldn't work either...

Again, my apologies. I changed this so it would work for Steam explicitly since I figured I could get the package details, might as well show them. I didn't realize you didn't want that; in that case, just revert the last commit and it should get rid of all the Steam package details while leaving the icon ID detection, which was the original point of this PR before I got sidetracked adding Steam details.

@mrixner
Copy link
Contributor Author

mrixner commented Jan 15, 2025

I didn't realize you didn't want that; in that case, just revert the last commit and it should get rid of all the Steam package details while leaving the icon ID detection, which was the original point of this PR before I got sidetracked adding Steam details.

Sorry, all of the commits besides the first*. Let me know if you want me to remove it, I'll open a new PR with just the icon changes when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants